/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package application;
import java.io.*;
import java.net.*;
/**
 *
 * @author suvam
 */
public class InputDataThread extends Thread
{
    Socket threadSoc;

    InputDataThread(Socket inSoc)
    {
        threadSoc = inSoc;
    }

    public void run()
    {
        try
        {
            String inputLine;
            BufferedReader in = new BufferedReader(new InputStreamReader(threadSoc.getInputStream()));
             while(true)
             {

                inputLine = in.readLine();

                System.out.println("Friend : " + inputLine);
                if (inputLine.equals("Bye."))
                    break;
            }
             in.close();
        }
        catch(Exception e)
        {
            System.out.println("Whoops! " +
            e.toString());
        }

    }

}
